<template>
  <div class="tab flex">
    <div class="left">
      <nuxt-link :to="{name:'index'}">全部</nuxt-link>
      <nuxt-link :to="{name:'node',params:{id:item.id}}" v-for="item in categorys" :key="item.id"
                 v-text="item.title"></nuxt-link>
    </div>
    <div class="right">
      <el-button type="primary" size="mini" @click="$emit('post')">发帖</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: "Category",
  props: {
    categorys: {
      type: Array,
      default: () => []
    }
  }
}
</script>

<style scoped lang="less">
.tab {
  border-bottom: var(--border-color) 1px solid;
  padding-bottom: 10px;

  a {
    margin-right: 20px;
  }

  .right {
    //text-align: right;
    flex: 0;
  }
}

</style>
